package com.lys.dao;


import com.lys.entity.News;
import com.lys.param.NewsParams;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 新闻的dao
 */
@Mapper
public interface NewsDao  {

	/**
	 * 新增新闻信息
	 * @param news
	 * @throws Exception
	 */
	public void save(News news) throws Exception;

	/**
	 * 修改
	 * @param news
	 * @throws Exception
	 */
	public void update(News news) throws Exception;

	/**
	 * 根据id删除
	 * @param id
	 * @throws Exception
	 */
	public void deleteById(Integer id) throws Exception;

	/**
	 * 根据id获取新闻详细信息
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public News getNewsById(Integer id)throws Exception;

	/**
	 * 获取所有的新闻信息
	 * @return
	 */
	public List<News> getAllNews();

	/**
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<News> queryNewsList(NewsParams params)throws Exception;

	/**
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public Integer queryNewsCount(NewsParams params)throws Exception; 
}